package fastadmin

import "fmt"

type Response struct {
	Data any    `json:"data,omitempty"`
	Msg  string `json:"msg"`
	Code int    `json:"code"`
}

func NewSuccess(data any) *Response {
	return &Response{
		Data: data,
		Code: 1,
	}
}
func NewError(msg any) *Response {
	return &Response{
		Msg:  fmt.Sprintf("%s", msg),
		Code: 0,
	}
}
